import requests

# 测试单个帖子获取API
url = "http://192.168.155.218:1001/forum/ForumPostFindById/1"
print(f"测试URL: {url}")

try:
    response = requests.get(url)
    print(f"状态码: {response.status_code}")
    print(f"响应内容: {response.text}")
    
    if response.status_code == 200:
        data = response.json()
        print("✅ API调用成功!")
        print(f"帖子ID: {data.get('id')}")
        print(f"标题: {data.get('title')}")
        print(f"内容: {data.get('content', '')[:100]}...")
    else:
        print(f"❌ API调用失败: {response.text}")
        
except Exception as e:
    print(f"❌ 发生错误: {e}")
